let rec power x n=
      if n<0 then
          invalid_arg "puissance negative"
      else
   
      match n with
          0 -> 1
         |_ -> x * power x (n-1);;


let rec application liste x =
      match liste with
     [] -> 0
    |(a,b)::l when a <= 0 -> failwith "le coefficient est negatif ou nul"
    |(a,0)::l -> a + application l x 
    |(a,b)::l -> a * power x b + application l x ;; 

application [(2,2);(2,3);(4,4)] 2;;

let rec addition l1 l2=
      match (l1,l2) with
     ([],[]) -> 0
     |([],(a2,b2)::l2) -> (a2,b2)::l2
     |((a1,b1)::l1,[]) -> (a1,b1)::l1
     |((a1,b1)::l1 , (a2,b2)::l2) -> if b1 = b2 
                                    then (a1+a2,b1)::l
      else (a1,b1)::(a2,b2)=
    |
